package com.avengers.common.bean.enums.api.epp;

/**
 * @author yu.wang
 * @since 2019-09-30 10:07
 **/
public enum ApiTaskType {
    /**
     * 模板认证结果
     */
    templateAuth(1),
    /**
     * 过户
     */
    templateUpdate(2),
    /**
     * 修改dns
     */
    dnsUpdate(3),
    /**
     * 转出
     */
    transferOut(4),
    /**
     * 域名续费
     */
    domainRenew(5);

    public final Integer value;

    ApiTaskType(int value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return value.toString();
    }

    public static ApiTaskType of(Integer value) {
        for (ApiTaskType type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        return null;
    }

    public static boolean isValid(Integer value) {
        return null != of(value);
    }
}
